Optimal. Leaf size=141 \[ -\frac {3 i a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {2 i \sqrt {2} a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {i a^2}{d \sqrt {a+i a \tan (c+d x)}}-\frac {a^2 \cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.27, antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 8, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3634, 3677,
3681, 3561, 212, 3680, 65, 214} \begin {gather*} -\frac {3 i a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {2 i \sqrt {2} a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {i a^2}{d \sqrt {a+i a \tan (c+d x)}}-\frac {a^2 \cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 212
Rule 214
Rule 3561
Rule 3634
Rule 3677
Rule 3680
Rule 3681
Rubi steps
\begin {align*} \int \cot ^2(c+d x) (a+i a \tan (c+d x))^{3/2} \, dx &=-\frac {a^2 \cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\int \frac {\cot (c+d x) \left (-\frac {3 i a^2}{2}+\frac {5}{2} a^2 \tan (c+d x)\right )}{\sqrt {a+i a \tan (c+d x)}} \, dx\\ &=-\frac {i a^2}{d \sqrt {a+i a \tan (c+d x)}}-\frac {a^2 \cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {\int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} \left (-\frac {3 i a^3}{2}+\frac {1}{2} a^3 \tan (c+d x)\right ) \, dx}{a^2}\\ &=-\frac {i a^2}{d \sqrt {a+i a \tan (c+d x)}}-\frac {a^2 \cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}+\frac {3}{2} i \int \cot (c+d x) (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)} \, dx-(2 a) \int \sqrt {a+i a \tan (c+d x)} \, dx\\ &=-\frac {i a^2}{d \sqrt {a+i a \tan (c+d x)}}-\frac {a^2 \cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}+\frac {\left (3 i a^2\right ) \text {Subst}\left (\int \frac {1}{x \sqrt {a+i a x}} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac {\left (4 i a^2\right ) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=\frac {2 i \sqrt {2} a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {i a^2}{d \sqrt {a+i a \tan (c+d x)}}-\frac {a^2 \cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}+\frac {(3 a) \text {Subst}\left (\int \frac {1}{i-\frac {i x^2}{a}} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=-\frac {3 i a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {2 i \sqrt {2} a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {i a^2}{d \sqrt {a+i a \tan (c+d x)}}-\frac {a^2 \cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.45, size = 178, normalized size = 1.26 \begin {gather*} \frac {a e^{-\frac {1}{2} i (2 c+3 d x)} \sqrt {\frac {a e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}} \sqrt {1+e^{2 i (c+d x)}} \left (-4 \sinh ^{-1}\left (e^{i (c+d x)}\right )+3 \sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {2} e^{i (c+d x)}}{\sqrt {1+e^{2 i (c+d x)}}}\right )-i \sqrt {1+e^{2 i (c+d x)}} \csc (c+d x)\right ) \left (-i \cos \left (\frac {d x}{2}\right )+\sin \left (\frac {d x}{2}\right )\right )}{\sqrt {2} d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 630 vs. \(2 (115 ) = 230\).
time = 0.84, size = 631, normalized size = 4.48
method | result | size |
default | \(\frac {\sqrt {\frac {a \left (i \sin \left (d x +c \right )+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \left (4 i \sqrt {2}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \cos \left (d x +c \right ) \sin \left (d x +c \right )+4 i \sqrt {2}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sin \left (d x +c \right )+3 i \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \ln \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )-\cos \left (d x +c \right )+1}{\sin \left (d x +c \right )}\right ) \cos \left (d x +c \right ) \sin \left (d x +c \right )+4 \sqrt {2}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right ) \cos \left (d x +c \right ) \sin \left (d x +c \right )+3 i \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \ln \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )-\cos \left (d x +c \right )+1}{\sin \left (d x +c \right )}\right ) \sin \left (d x +c \right )+4 \sqrt {2}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right ) \sin \left (d x +c \right )+3 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right ) \cos \left (d x +c \right ) \sin \left (d x +c \right )-2 i \left (\cos ^{2}\left (d x +c \right )\right )+3 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right ) \sin \left (d x +c \right )-2 i \cos \left (d x +c \right )+2 \sin \left (d x +c \right ) \cos \left (d x +c \right )\right ) a}{2 d \left (i \sin \left (d x +c \right )+\cos \left (d x +c \right )-1\right ) \left (1+\cos \left (d x +c \right )\right )}\) | \(631\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 132, normalized size = 0.94 \begin {gather*} -\frac {i \, {\left (2 \, \sqrt {2} \sqrt {a} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) - 3 \, \sqrt {a} \log \left (\frac {\sqrt {i \, a \tan \left (d x + c\right ) + a} - \sqrt {a}}{\sqrt {i \, a \tan \left (d x + c\right ) + a} + \sqrt {a}}\right ) - \frac {2 i \, \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\tan \left (d x + c\right )}\right )} a}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 501 vs. \(2 (108) = 216\).
time = 0.46, size = 501, normalized size = 3.55 \begin {gather*} -\frac {4 \, \sqrt {2} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a^{3}}{d^{2}}} \log \left (\frac {4 \, {\left (a^{2} e^{\left (i \, d x + i \, c\right )} + {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {-\frac {a^{3}}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{a}\right ) - 4 \, \sqrt {2} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a^{3}}{d^{2}}} \log \left (\frac {4 \, {\left (a^{2} e^{\left (i \, d x + i \, c\right )} + {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {-\frac {a^{3}}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{a}\right ) + 3 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a^{3}}{d^{2}}} \log \left (16 \, {\left (3 \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 \, \sqrt {2} {\left (i \, d e^{\left (3 i \, d x + 3 i \, c\right )} + i \, d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {a^{3}}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} + a^{2}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}\right ) - 3 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a^{3}}{d^{2}}} \log \left (16 \, {\left (3 \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 \, \sqrt {2} {\left (-i \, d e^{\left (3 i \, d x + 3 i \, c\right )} - i \, d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {a^{3}}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} + a^{2}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}\right ) + 4 \, \sqrt {2} {\left (i \, a e^{\left (3 i \, d x + 3 i \, c\right )} + i \, a e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{\frac {3}{2}} \cot ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.20, size = 112, normalized size = 0.79 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\sqrt {-a^3}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{a^2}\right )\,\sqrt {-a^3}\,3{}\mathrm {i}}{d}-\frac {a\,\mathrm {cot}\left (c+d\,x\right )\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{d}-\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {-a^3}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,a^2}\right )\,\sqrt {-a^3}\,2{}\mathrm {i}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________